CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

PROJECT(EyerColorSpace
        VERSION 1.0.0.0
        )

message( STATUS "CMAKE_PROJECT_NAME    = ${CMAKE_PROJECT_NAME}" )
message( STATUS "PROJECT_VERSION_MAJOR = ${PROJECT_VERSION_MAJOR}" )
message( STATUS "PROJECT_VERSION_MINOR = ${PROJECT_VERSION_MINOR}" )
message( STATUS "PROJECT_VERSION_PATCH = ${PROJECT_VERSION_PATCH}" )
message( STATUS "PROJECT_VERSION_TWEAK = ${PROJECT_VERSION_TWEAK}" )
message( STATUS "PROJECT_HOMEPAGE_URL = ${PROJECT_HOMEPAGE_URL}")
message( STATUS "CMAKE_PROJECT_DESCRIPTION = ${CMAKE_PROJECT_DESCRIPTION}" )

include_directories (${CMAKE_SOURCE_DIR}/../Lib/libpng_install/include)
include_directories (${CMAKE_SOURCE_DIR}/../Lib/zlib_install/include)
link_directories(${CMAKE_SOURCE_DIR}/../Lib/libpng_install/lib)
link_directories(${CMAKE_SOURCE_DIR}/../Lib/zlib_install/lib)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")

SET(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install/)

# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -s WASM=1 -s USE_SDL=2 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=7 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['ccall','stringToUTF8']\" -s ASSERTIONS=1 -O3 ")
# vset(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s WASM=1 -s USE_SDL=2 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=7 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['ccall','stringToUTF8']\" -s ASSERTIONS=1 -O3 ")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -s WASM=1 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['ccall','stringToUTF8']\" -s ASSERTIONS=1 -O3 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s WASM=1 -s FULL_ES2=1 -s FULL_ES3=1 -s USE_WEBGL2=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['ccall','stringToUTF8']\" -s ASSERTIONS=1 -O3 ")


IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
    MESSAGE(STATUS "current platform: Linux ")
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
    MESSAGE(STATUS "current platform: Windows")
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android")
    MESSAGE(STATUS "current platform: Android")
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
    MESSAGE(STATUS "current platform: Darwin")
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Emscripten")
    MESSAGE(STATUS "current platform: Emscripten")
    ADD_DEFINITIONS(-D EYER_PLATFORM_EMSCRIPTEN)
ELSE ()
    MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

ADD_SUBDIRECTORY(EyerGL)
ADD_SUBDIRECTORY(EyerCore)
ADD_SUBDIRECTORY(EyerThread)
ADD_SUBDIRECTORY(EyerGLCustomComponent)
ADD_SUBDIRECTORY(EyerGLShader)
ADD_SUBDIRECTORY(EyerMath)
ADD_SUBDIRECTORY(EyerColorSpace)
ADD_SUBDIRECTORY(EyerVideoEditor)
ADD_SUBDIRECTORY(EyerImage)